package com.xianxiaohui.adapter;

import java.util.concurrent.Callable;

/**
 * @author gjl
 */
public class Task implements Callable<Long> {

    private long num;

    public Task(long num) {
        this.num = num;
    }

    @Override
    public Long call() throws Exception {
        long r = 0;
        for (long n=1;n<= this.num;n++) {
            r = r + n;
        }
        System.out.println("result r:" + r);

        return r;
    }
}
